<template>
  <div class="main">
    <div class="headBG">
      <img src="../../assets/img/headBG@2x.png" style="height: 1.86rem;width: 100%;"/>
      <div class="head">
        <div class="title">业务进度查询</div>
        <div class="subtitle"><span>服务适用范围：</span><span style="color: #6EA1ED;font-size: 0.26rem">湖北省{{dlwz}}</span></div>
      </div>
    </div>
    <div style="padding: 0 0.5rem 0.5rem 0.5rem">
      <div class="content">
        <div @click="goUrl(pro)" v-for="pro in procedures" class="border-b row" style="color:#A5ADB9;">
          <p><span>业务名称：</span><span>{{pro.procName}}</span></p>
          <p><span>受理编号：</span><span>{{pro.prjId}}</span></p>
          <p><span>受理日期：</span><span>{{pro.slsj}}</span></p>
          <span class="arrowIcon"><img src="../../assets/img/arrow.svg" style="width: 0.3rem"/></span>
        </div>
      </div>
    </div>
    <div class="footer">
      本服务由{{GLOBAL.provider[this.GLOBAL.urlType]}}提供
    </div>
  </div>
</template>

<script>
  /*//需要命令  npm install moment --save*/
    let moment = require("moment");
    export default {
        name: 'Procedures',
        data() {
            return {
                dlwz: this.GLOBAL.dicHandle.getName(2,"dlwz"),
                //isShow: false,
                procedures: [
                    /*{
                      "slsj": "2019-03-19 09:12:23",
                      "procName": "预告登记",
                      "slbh": "201903190003",
                      "prjId": "201903190003"
                    },
                    {
                      "slsj": "2019-03-18 17:55:31",
                      "procName": "预告登记",
                      "slbh": "201903180007",
                      "prjId": "201903180007"
                    }*/
                ]
            }
        },
        mounted() {
            this.startDate = moment().subtract(1, 'M').format("YYYY-MM-DD");
            this.endDate = moment().format("YYYY-MM-DD");
            let that = this;
            ehbAppJssdk.user.getUserInfo({
                success: function (res) {
                    that.zjh = res.idCards;
                     //that.zjh = '420704198410141278';
                    that.qlr = res.names;
                     //that.qlr = '张海轮';
                }
            });
            if (!that.zjh) {
                ehbAppJssdk.notice.alert({title: '提示', message: '请先登陆!', buttonName: '确定'});
                return;
            }
            ehbAppJssdk.notice.showPreloader({text: "正在查询中.."});
            ehbAppJssdk.network.request({
                url: that.GLOBAL.urlConfig.queryProcess[that.GLOBAL.urlType],
                method: 'post',
                data: {
                    'startDate': that.startDate,
                    'endDate': that.endDate,
                    'zjh': that.zjh
                    //TODO:测试环境数据，正式环境要改
                    //'zjh': '421004197809122552'

                },
                headers: {'contentType': 'application/x-www-form-urlencoded'},
                success: function (res) {
                  ehbAppJssdk.notice.hidePreloader();
                    //that.isShow = true;
                    if (res.status == 0) {
                        that.procedures = res.result;
                        if (that.procedures.length == 0) {
                            that.$router.replace({path:'NotFound', name: 'NotFound', params: {info: '未查询到办理的业务'}});
                        }
                    } else {
                        that.$router.replace({path:'NotFound', name: 'NotFound', params: {info: '未查询到办理的业务'}});
                    }
                },
                fail: function (res) {
                    ehbAppJssdk.notice.hidePreloader();
                    that.$router.replace({path:'NotFound', name: 'NotFound', params: {info: '未查询到办理的业务'}});
                }
            })
        },
        methods: {
            goUrl(pro) {
                let that = this;
                // ehbAppJssdk.operateWindow.open({
                //     title: '',
                //     url: absoultPath + "/#/StepState",
                //     urlType: 'app',
                //     backRefresh: '0',
                //     reloadForLogin: '1',
                //     closeCurrentPage: '0',
                //     disableScrolling: 'disable',
                //     params: {
                //         qlr: that.qlr,
                //         zjh: that.zjh,
                //         pro: JSON.stringify(pro)
                //     },
                //     pageType: '1',
                //     pageLevel: '2',
                // });
              /*that.$router.push({
                path: absoultPath + '/onlineProcessing/StepState',
                name: '查看详情',
                params: {
                  qlr: that.qlr,
                  zjh: that.zjh,
                  pro: JSON.stringify(pro)
                }
              });*/
              that.$router.push({path: "StepState", name: 'StepState', params: {
                  qlr: that.qlr,
                  zjh: that.zjh,
                  pro: JSON.stringify(pro)
                }});
               /* ehbAppJssdk.operateWindow.open({
                    title: '',
                    url: absoultPath + "/onlineProcessing/StepState",
                    urlType: 'webPage',
                    backRefresh: '1',
                    reloadForLogin: '1',
                    closeCurrentPage: '0',
                    disableScrolling: 'able',
                    pageType: '1',
                    pageLevel: '2',
                    params: {
                        qlr: that.qlr,
                        zjh: that.zjh,
                        pro: JSON.stringify(pro)
                    }
                });*/
            }
        }
    }
</script>

<style scoped>
  .main {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    bottom: 0;
  }

  .border-b {
    border-bottom: #DDDDE0 solid 0.01rem;
  }

  .head {
    height: 1.86rem;
    width: 100%;
    padding-top: 0.4rem;
    padding-left: 0.4rem;
    position: absolute;
    top: 0;
  }

  .title {
    width: 6.5rem;
    height: 0.52rem;
    font-size: 0.44rem;
    font-family: PingFangSC-Medium;
    font-weight: bold;
    color: rgba(39, 49, 64, 1);
    line-height: 0.52rem;
  }

  .subtitle {
    width: 6.5rem;
    height: 0.34rem;
    margin-top: 0.2rem;
    font-size: 0.26rem;
    font-family: PingFangSC-Regular;
    font-weight: 400;
    color: rgba(165, 173, 185, 1);
    line-height: 0.34rem;
  }

  .arrowIcon {
    width: 0.3rem;
    height: 0.4rem;
    position: absolute;
    top: 40%;
    right: 0;
  }

  .content {
    font-size: 0.3rem;
    font-family: PingFangSC-Regular;
    font-weight: 400;
    color: rgba(39, 49, 64, 1);
    line-height: 0.44rem;
    width: 100%;
  }

  .content .row {
    position: relative;
    padding: 0.4rem 0;
  }

  .footer {
    height: 0.34rem;
    font-size: 0.26rem;
    font-family: PingFangSC-Regular;
    font-weight: 400;
    line-height: 0.34rem;
    position: absolute;
    left: 0rem;
    bottom: 0.8rem;
    text-align: center;
    color: #A5ADB9;
    width: 100%;
  }
</style>
